package net.sareweb.acab.session;

import net.sareweb.acab.entity.*;
import java.util.ArrayList;
import java.util.List;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("countryHome")
public class CountryHome extends EntityHome<Country> {

	public void setCountryIdCountry(Integer id) {
		setId(id);
	}

	public Integer getCountryIdCountry() {
		return (Integer) getId();
	}

	@Override
	protected Country createInstance() {
		Country country = new Country();
		return country;
	}

	public void load() {
		if (isIdDefined()) {
			wire();
		}
	}

	public void wire() {
		getInstance();
	}

	public boolean isWired() {
		return true;
	}

	public Country getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

	public List<Travel> getTravelsForFromCountry() {
		return getInstance() == null ? null : new ArrayList<Travel>(
				getInstance().getTravelsForFromCountry());
	}

	public List<State> getStates() {
		return getInstance() == null ? null : new ArrayList<State>(
				getInstance().getStates());
	}

	public List<Request> getRequestsForToCountry() {
		return getInstance() == null ? null : new ArrayList<Request>(
				getInstance().getRequestsForToCountry());
	}

	public List<Request> getRequestsForFromCountry() {
		return getInstance() == null ? null : new ArrayList<Request>(
				getInstance().getRequestsForFromCountry());
	}

	public List<Travel> getTravelsForToCountry() {
		return getInstance() == null ? null : new ArrayList<Travel>(
				getInstance().getTravelsForToCountry());
	}

}
